#include "net/poller.h"

#include "net/module/epoll.h"
#include "net/module/poll.h"
#include "net/module/select.h"

namespace net {
Poller* CreatePoller() {
  const char* poll = ::getenv("NET_POLL");
  if (poll == NULL || ::strcmp(poll, "epoll") == 0) {
    LOG(INFO)<< "poller use: epoll";
    return new Epoll;
  } else if (::strcmp(poll, "poll") == 0) {
    LOG(INFO) << "poller use: poll";
    return new Poll;
  }

  LOG(INFO)<< "poller use select";
  return new Select;
}
}
